package com.song.oscsong.api;

import com.loopj.android.http.AsyncHttpClient;
import com.loopj.android.http.AsyncHttpResponseHandler;
import com.loopj.android.http.RequestParams;
import com.loopj.android.http.SyncHttpClient;

public class ApiHttpClient {

    public final static String HOST = "www.oschina.net";
    private static String API_URL = "http://www.oschina.net/%s";
    public static final String DELETE = "DELETE";
    public static final String GET = "GET";
    public static final String POST = "POST";
    public static final String PUT = "PUT";
	
	public static  AsyncHttpClient client = new AsyncHttpClient();
	
	public ApiHttpClient()
	{

	}
    
    public static void get(String suburl ,RequestParams params , AsyncHttpResponseHandler handler)
    {
    	String url = String.format(API_URL, suburl);
    	client.get(url, params, handler);
    }
    
    
    public static void post(String suburl ,RequestParams params , AsyncHttpResponseHandler handler)
    {
    	String url = String.format(API_URL, suburl);
    	client.post(url, params, handler);
    }
}
